package puzfun.tow.enhance;

public class PropertyEnhance {
	private int strength,energy,magic;

	public int getStrength() {
		return strength;
	}

	public void setStrength(int strength) {
		this.strength = strength;
	}

	public int getEnergy() {
		return energy;
	}

	public void setEnergy(int energy) {
		this.energy = energy;
	}

	public int getMagic() {
		return magic;
	}

	public void setMagic(int magic) {
		this.magic = magic;
	}

	public PropertyEnhance(int strength,int energy,int magic)
	{
		this.setStrength(strength);
		this.setEnergy(energy);
		this.setMagic(magic);
	}
	
	public void saveEnhance(int strength,int energy,int magic)
	{
		this.strength = (this.strength+strength);
		this.energy = (this.energy+energy);
		this.magic = (this.magic+magic);
		
		if(this.strength < 0)
			this.strength = 0;
		if(this.energy < 0)
			this.energy = 0;
		if(this.magic < 0)
			this.magic = 0;
	}
	
	public int creatRandomEnhance(int intCurrentValue)
	{
		return -(int) ((Math.random()*(intCurrentValue+5))-5);
	}
}
